Location_();
$('.return_bth').click(function() {
	$('.view_pop').css('display', 'none')
})

$('.editor-title button').click(function() {
	$('.Editor-page').css('display', 'none')
})


layui.use('element', function() {
	var element = layui.element;
})
//网谈日期范围
layui.use('laydate', function() {
	var laydate = layui.laydate;
	laydate.render({
		elem: '#test6',
		range: true
	})
});
//个人添加日期范围
layui.use('laydate', function() {
	var laydate = layui.laydate;
	laydate.render({
		elem: '#test7',
		range: true
	})
});
//留言日期范围
layui.use('laydate', function() {
	var laydate = layui.laydate;
	laydate.render({
		elem: '#test8',
		range: true
	})
});
//批量日期范围
layui.use('laydate', function() {
	var laydate = layui.laydate;
	laydate.render({
		elem: '#test9',
		range: true
	})
});

layui.use('form', function() {
	var form = layui.form;
	//			form.on('submit(formDemo)', function(data) {
	//				layer.msg(JSON.stringify(data.field));
	//				return false;
	//			});
});

layui.use(['jquery', 'layer'], function() {
	var $ = layui.$ //重点处
		,
		layer = layui.layer;
});
//网谈table
layui.use('table', function() {
	var table = layui.table;
	//监听表格复选框选择
	table.on('checkbox(demo)', function(obj) {
		console.log(obj)
	});
	//监听工具条
	table.on('tool(demo1)', function(obj) {
		var data = obj.data;
		if(obj.event === 'detail') {
			$('.view_pop').css('display', 'block')
			//layer.msg('ID：' + data.id + ' 的查看操作');
		} else if(obj.event === 'edit') {
			$('.Editor-page').css('display','block')
//			layer.alert('编辑行：<br><input type="text">' + JSON.stringify(data))
		}
	});
	//搜索功能
	var $ = layui.$,
		active = {
			reload: function() {
				var demoReload = $('#demoReload');

				//执行重载
				table.reload('idTest', {
					page: {
						curr: 1 //重新从第 1 页开始
					},
					where: {
						key: {
							id: demoReload.val()
						}
					}
				});
			}
		};

	$('.demoTable .layui-btn').on('click', function() {
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});
});